package com.gqz.equip.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gqz.equip.utils.ExcelImport;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 通用设备实体
 *
 * @author gqz20
 * @date 2023/02/18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_BIZC_ENERY_EQUIP")
public class TBizcEneryEquipEntity implements Serializable {

    /**
     * 设备编码
     */
    @TableId
    @ExcelImport("设备编码")
    private String sbbm;

    /**
     * 设备名称
     */
    @ExcelImport("设备名称")
    @TableField(value = "SBMC")
    private String sbmc;

    /**
     * 运行状态  10-未投运
     * 20-在运
     * 30-退役
     * 40-报废
     */
    @TableField(value = "YXZT")
    @ExcelImport("运行状态")
    private String yxzt;

    /**
     * 计量方式
     */
    @ExcelImport("计量方式")
    @TableField(value = "JLFS")
    private String jlfs;

    /**
     * 是否删除  0否1是
     */
    @ExcelImport("是否删除")
    @TableField(value = "SFSC")
    private String sfsc;

    /**
     * 容量
     */
    @ExcelImport("容量")
    @TableField(value = "CAP")
    private String cap;

    /**
     * 设备类型编码
     */
    @ExcelImport("设备类型")
    @TableField(value = "SBLX")
    private String sblx;

    /**
     * 设备类型名称
     */
    @ExcelImport("设备类型名称")
    @TableField(value = "SBLXMC")
    private String sblxmc;

    /**
     * 数量
     */
    @ExcelImport("数量")
    @TableField(value = "NUM")
    private String num;

    /**
     * 规格
     */
    @ExcelImport("规格")
    @TableField(value = "STANDARD")
    private String standard;

    /**
     * 型号
     */
    @ExcelImport("型号")
    @TableField(value = "XH")
    private String xh;

    /**
     * 厂家名称
     */
    @ExcelImport("厂家名称")
    @TableField(value = "CJMC")
    private String cjmc;

    /**
     * 出厂编码
     */
    @ExcelImport("出厂编码")
    @TableField(value = "CCBM")
    private String ccbm;

    /**
     * 出场日期
     */
    @ExcelImport("出场日期")
    @TableField(value = "CC_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "ccTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date ccTime;

    /**
     * 实际到货日期
     */
    @ExcelImport("实际到货日期")
    @TableField(value = "SJDH_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "sjdhTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date sjdhTime;

    /**
     * 产业单位名称
     */
    @ExcelImport("产业单位名称")
    @TableField(value = "CY_DWMC")
    private String cyDwmc;

    /**
     * 项目联系人
     */
    @ExcelImport("项目联系人")
    @TableField(value = "XMLXR")
    private String xmlxr;

    /**
     * 项目名称
     */
    @TableField(value = "XMMC")
    @ExcelImport("项目名称")
    private String xmmc;

    /**
     * 项目编号
     */
    @TableField(value = "XMBH")
    @ExcelImport("项目编号")
    private String xmbh;

    /**
     * 租赁期限
     */
    @ExcelImport("租赁期限")
    @TableField(value = "ZLQX")
    private String zlqx;

    /**
     * 预计撤场时间
     */
    @ExcelImport("预计撤场时间")
    @TableField(value = "YJCC_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "yjccTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date yjccTime;

    /**
     * 项目地址
     */
    @ExcelImport("项目地址")
    @TableField(value = "XMDZ")
    private String xmdz;

    /**
     * 联系人电话
     */
    @ExcelImport("联系人电话")
    @TableField(value = "LXR_PHONE")
    private String lxrPhone;

    /**
     * 联络时间
     */
    @ExcelImport("联络时间")
    @TableField(value = "LX_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "lxTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date lxTime;

    /**
     * 单据回收状态  0未回收 1 已回收
     */
    @ExcelImport("单据回收状态")
    @TableField(value = "DJHSZT")
    private String djhszt;

    /**
     * 产业单位编码
     */
    @TableField(value = "CY_DWBM")
    @ExcelImport("产业单位编码")
    private String cyDwbm;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<TBizcEneryEquipEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("sbbm", TBizcEneryEquipEntity::getSbbm);
        map.put("sbmc", TBizcEneryEquipEntity::getSbmc);
        map.put("yxzt", TBizcEneryEquipEntity::getYxzt);
        map.put("jlfs", TBizcEneryEquipEntity::getJlfs);
        map.put("sfsc", TBizcEneryEquipEntity::getSfsc);
        map.put("cap", TBizcEneryEquipEntity::getCap);
        map.put("sblx", TBizcEneryEquipEntity::getSblx);
        map.put("sblxmc", TBizcEneryEquipEntity::getSblxmc);
        map.put("num", TBizcEneryEquipEntity::getNum);
        map.put("standard", TBizcEneryEquipEntity::getStandard);
        map.put("xh", TBizcEneryEquipEntity::getXh);
        map.put("cjmc", TBizcEneryEquipEntity::getCjmc);
        map.put("ccbm", TBizcEneryEquipEntity::getCcbm);
        map.put("ccTime", TBizcEneryEquipEntity::getCcTime);
        map.put("sjdhTime", TBizcEneryEquipEntity::getSjdhTime);
        map.put("cyDwmc", TBizcEneryEquipEntity::getCyDwmc);
        map.put("xmlxr", TBizcEneryEquipEntity::getXmlxr);
        map.put("xmmc", TBizcEneryEquipEntity::getXmmc);
        map.put("xmbh", TBizcEneryEquipEntity::getXmbh);
        map.put("zlqx", TBizcEneryEquipEntity::getZlqx);
        map.put("yjccTime", TBizcEneryEquipEntity::getYjccTime);
        map.put("xmdz", TBizcEneryEquipEntity::getXmdz);
        map.put("lxrPhone", TBizcEneryEquipEntity::getLxrPhone);
        map.put("lxTime", TBizcEneryEquipEntity::getLxTime);
        map.put("djhszt", TBizcEneryEquipEntity::getDjhszt);
        map.put("cyDwbm", TBizcEneryEquipEntity::getCyDwbm);

    }

    public static SFunction<TBizcEneryEquipEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end这个是必须要的动态条件集合end   end */


}
